<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>

<div class="p_t_24 uc_share_box">
	<h3 class="fb_14 line_30 p_b_8">分享到SNS社区</h3>
	<input type="hidden" id="tips_mask_share_title" value="分享内容"/>
	<input type="hidden" id="tips_mask_share_url" value="分享url"/>
	<div class="app_share_mask">
		<ul class="c">
			<li>
				<em class="app_share_sina"></em><a href="javascript:void(0)" title="新浪微博" onclick="snsShareFun({id:'tsina',isNeedLoginTip:''})">新浪微博</a>
			</li>
			<li>
				<em class="app_share_qq"></em><a href="javascript:void(0)" title="腾讯微博" onclick="snsShareFun({id:'tqq',isNeedLoginTip:''})">腾讯微博</a>
			
			</li>
			<li>
				<em class="app_share_sohu"></em><a href="javascript:void(0)" title="搜狐微博" onclick="snsShareFun({id:'sohu',isNeedLoginTip:''})">搜狐微博</a>
			</li>
			<li>
				<em class="app_share_ren"></em><a href="javascript:void(0)" title="人人网" onclick="snsShareFun({id:'xiaonei',isNeedLoginTip:''})">人人网</a>
			</li>
			<li>
			
				<em class="app_share_qzone"></em><a href="javascript:void(0)" title="腾讯空间" onclick="snsShareFun({id:'qzone',isNeedLoginTip:''})">腾讯空间</a>
			</li>
			<li>
				<em class="app_share_doban"></em><a href="javascript:void(0)" title="豆瓣网" onclick="snsShareFun({id:'douban',isNeedLoginTip:''})">豆瓣网</a>
			</li>
			<!-- 
			<li class="no_pb">
				<em class="app_share_baidu"></em><a href="javascript:void(0)" title="百度贴吧">百度贴吧</a>
			</li>
			 -->
			<li class="no_pb">
				<em class="app_share_msn"></em><a href="javascript:void(0)" title="MSN" onclick="snsShareFun({id:'msn',isNeedLoginTip:''})">MSN</a>
			</li>
		</ul>
	</div>
</div>

</body>
</html>

<script type="text/javascript">
    /**微博转发
     * para: {id:'sohu',isNeedLoginTip:'登陆后分享可能会获得推荐奖金，确认吗?',loginedMethod:getJobUserLink}
     * 默认调用方式：snsShareFun({id:'tqq',isNeedLoginTip:''})
     * 调用该方法的前提条件：
     * 1.需要为本页面的内容隐藏域：tips_mask_share_title 赋值
     * 2.需要为本页面的URL隐藏域：tips_mask_share_url 赋值
     * 3.需要在调用本方法的页面声明变量 var jobID （工作ID） 并为给变量赋值
     * 4.用到全局变量变量：isLogin，保证该值的正确性
     */
    var goUrl;
    function snsShareFun(obj){
        //微博类型
		var v_type;
        //跳转到微博的URL
		var url ;
        //新开窗口tip
		var tip ;
		var shareType ;
		
        if (obj.id=="sohu"){
			url="http://t.sohu.com/third/post.jsp?url=?share_url&title=?share_title&content=utf-8";
            tip="转播到搜狐微博";
            v_type="0";
            shareType="souhu";
		}else if (obj.id=="tqq"){
			url="http://v.t.qq.com/share/share.php?title=?share_title&url=?share_url&site=www.aceona.com&appkey="+encodeURI('7c3450bbecd247758089ee8df5cf546c');
            tip="转播到腾讯微博";
            v_type="1";
            shareType="qq";
		}else if (obj.id=="tsina"){
			url="http://v.t.sina.com.cn/share/share.php?title=?share_title&url=?share_url&appkey=" + 2937052444+ "&site=www.aceona.com&content=utf-8";
            tip="转播到新浪微博";
            v_type="2";
            shareType="weibo";
		}else if (obj.id=="qzone"){
			url="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=?share_url&title=?share_title";
            tip="转播到QQ空间";
            v_type="3";
            shareType="qzone";
		}else if (obj.id=="bsh"){
			url="http://bai.sohu.com/share/blank/add.do?link=?share_url&title=?share_title";
            tip="转播到白社会";
            v_type="4";
            shareType="bsh";
		}else if (obj.id=="douban"){
			url="http://www.douban.com/recommend/?url=?share_url&title=?share_title";
            tip="转播到豆瓣网";
            v_type="5";
            shareType="douban";
		}else if (obj.id=="xiaonei"){
			url="http://share.renren.com/share/buttonshare.do?link=?share_url&title=?share_title";
            tip="转播到人人网";
            v_type="6";
            shareType="renren";
		}else if (obj.id=="msn"){
			url="http://profile.live.com/badge/?url=?share_url&title=?share_title";
			tip="转播到MSN";
			v_type="7";
			shareType="msn";
		} 
        goUrl = url;
		var isNeedLoginTip = obj.isNeedLoginTip;
		var loginedMethod = obj.loginedMethod;
		//判断是否需要登陆
		if(typeof(isNeedLoginTip)!="undefined")
		{
			getCurrentUser(function(result){
			    
		   	    if(result.RESULT=="unauthorized"){//未登陆
	       			if(isNeedLoginTip==''){
	       				isNeedLoginTip='登陆后邀请，确认吗?';
	       			}
	  				jConfirm(isNeedLoginTip,"温馨提示",
			       	         function(flag) 
			       	         {   
			       		         if(flag)
			       		         {
			       		             showLoginDiv();
			       		         }
			       		         else
			       		         {
			       		        	 commonShare(goUrl,tip,shareType);
			       		         }
			       	});
		   	    }else{//已经登陆
					if(typeof(loginedMethod)!="undefined")
					{
						loginedMethod(v_type,callback);
					}else{
							commonShare(goUrl,tip,shareType);
					}
		   		}
	   	    });
		}else
		{
			commonShare(goUrl,tip,shareType);
		}
    } // end snsShareFun

	function commonShare(url,tip,shareType)
    {
    	//定义新开窗口样式
	    var defaultFeatures={
	        scrollbars:"no",
	        status:"yes",
	        resizable:"no",
	        titlebar:"no", 
	        width:screen.availWidth-400,
	        height:screen.availHeight-200,
	        top:Math.ceil(100),
	        left:Math.ceil(200)
        };
    	var shareTitle = $("#tips_mask_share_title").val();
		var shareUrl = $("#tips_mask_share_url").val();
    	var content = url.replace("?share_url",encodeURIComponent(shareUrl)).replace("?share_title",encodeURIComponent(shareTitle));
		
        window.open(content,tip,defaultFeatures);
    }
</script>  